package com.example.demo.api;

import com.demo.sample.common.OperationResponse;
import com.example.demo.api.factory.RemoteAccountFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;

/**
 * @author zxk
 */
@FeignClient(value="seata-account", fallbackFactory = RemoteAccountFallbackFactory.class)
public interface RemoteAccountService {
    @PostMapping("account/debit")
    OperationResponse debit(@RequestParam("userId") Integer userId, @RequestParam("money") BigDecimal money);
}
